package API;

import org.w3c.dom.ls.LSOutput;

import java.util.Scanner;

public class ObjectIndex {
    public static void main(String[] args) {
        //equals()
        //Student 对象
        Student s1=new Student();
        Student s2=s1;
        Person p1=new Person();
        System.out.println(s1.equals(s2)?"是同一个对象":"不是同一个对象");
        System.out.println(s1.hashCode());
        System.out.println(s2.hashCode());
        int a=1;
        int b=1;
        Integer num1=new Integer(a);
        Integer num2=new Integer(b);
        System.out.println(num1.equals(num2));
        //StringBulider
        StringBuilder sb=new StringBuilder();
        //append
        sb.append("helloworld");
        System.out.println(sb);
        //reverse
//        sb.reverse();
        System.out.println(sb);
        //delete  字符串下标从零开始
//        sb.delete(1,3);
        System.out.println(sb);
        //insert
        sb.insert(5,"java");
        //replace
        sb.replace(5,9,"");
        System.out.println(sb);
        System.out.println(sb);
        String str=new String("hello");


    }
}
